3.96 \(\int \frac{\left (2-3 x+x^2\right ) \left (d+e x+f x^2+g x^3+h x^4+i x^5\right )}{\left (4-5 x^2+x^4\right )^2} \, dx\)

Optimal. Leaf size=147 \[ -\frac{d-2 e+4 f-8 g+16 h-32 i}{12 (x+2)}-\frac{d-e+f-g+h-i}{6 (x+1)}-\frac{1}{36} \log (1-x) (d+e+f+g+h+i)+\frac{1}{144} \log (2-x) (d+2 e+4 f+8 g+16 h+32 i)-\frac{1}{36} \log (x+1) (7 d-13 e+19 f-25 g+31 h-37 i)+\frac{1}{144} \log (x+2) (31 d-50 e+76 f-104 g+112 h-32 i) \]

[Out]

-(d - e + f - g + h - i)/(6*(1 + x)) - (d - 2*e + 4*f - 8*g + 16*h - 32*i)/(12*(
2 + x)) - ((d + e + f + g + h + i)*Log[1 - x])/36 + ((d + 2*e + 4*f + 8*g + 16*h
 + 32*i)*Log[2 - x])/144 - ((7*d - 13*e + 19*f - 25*g + 31*h - 37*i)*Log[1 + x])
/36 + ((31*d - 50*e + 76*f - 104*g + 112*h - 32*i)*Log[2 + x])/144

_______________________________________________________________________________________

Rubi [A]  time = 0.637047, antiderivative size = 147, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 46, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.043 \[ -\frac{d-2 e+4 f-8 g+16 h-32 i}{12 (x+2)}-\frac{d-e+f-g+h-i}{6 (x+1)}-\frac{1}{36} \log (1-x) (d+e+f+g+h+i)+\frac{1}{144} \log (2-x) (d+2 e+4 f+8 g+16 h+32 i)-\frac{1}{36} \log (x+1) (7 d-13 e+19 f-25 g+31 h-37 i)+\frac{1}{144} \log (x+2) (31 d-50 e+76 f-104 g+112 h-32 i) \]

Antiderivative was successfully verified.

[In]  Int[((2 - 3*x + x^2)*(d + e*x + f*x^2 + g*x^3 + h*x^4 + i*x^5))/(4 - 5*x^2 + x^4)^2,x]

[Out]

-(d - e + f - g + h - i)/(6*(1 + x)) - (d - 2*e + 4*f - 8*g + 16*h - 32*i)/(12*(
2 + x)) - ((d + e + f + g + h + i)*Log[1 - x])/36 + ((d + 2*e + 4*f + 8*g + 16*h
 + 32*i)*Log[2 - x])/144 - ((7*d - 13*e + 19*f - 25*g + 31*h - 37*i)*Log[1 + x])
/36 + ((31*d - 50*e + 76*f - 104*g + 112*h - 32*i)*Log[2 + x])/144

_______________________________________________________________________________________

Rubi in Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((x**2-3*x+2)*(i*x**5+h*x**4+g*x**3+f*x**2+e*x+d)/(x**4-5*x**2+4)**2,x)

[Out]

Timed out

_______________________________________________________________________________________

Mathematica [A]  time = 0.195181, size = 153, normalized size = 1.04 \[ \frac{1}{144} \left (\frac{12 (2 (e (2 x+3)-3 f x-4 f+5 g x+6 g-9 h x-10 h+17 i x+18 i)-d (3 x+5))}{x^2+3 x+2}-4 \log (1-x) (d+e+f+g+h+i)+\log (2-x) (d+2 e+4 (f+2 g+4 h+8 i))+4 \log (x+1) (-7 d+13 e-19 f+25 g-31 h+37 i)+\log (x+2) (31 d-50 e+76 f-104 g+112 h-32 i)\right ) \]

Antiderivative was successfully verified.

[In]  Integrate[((2 - 3*x + x^2)*(d + e*x + f*x^2 + g*x^3 + h*x^4 + i*x^5))/(4 - 5*x^2 + x^4)^2,x]

[Out]

((12*(-(d*(5 + 3*x)) + 2*(-4*f + 6*g - 10*h + 18*i - 3*f*x + 5*g*x - 9*h*x + 17*
i*x + e*(3 + 2*x))))/(2 + 3*x + x^2) - 4*(d + e + f + g + h + i)*Log[1 - x] + (d
 + 2*e + 4*(f + 2*g + 4*h + 8*i))*Log[2 - x] + 4*(-7*d + 13*e - 19*f + 25*g - 31
*h + 37*i)*Log[1 + x] + (31*d - 50*e + 76*f - 104*g + 112*h - 32*i)*Log[2 + x])/
144

_______________________________________________________________________________________

Maple [A]  time = 0.022, size = 266, normalized size = 1.8 \[{\frac{i}{6+6\,x}}+{\frac{8\,i}{6+3\,x}}-{\frac{h}{6+6\,x}}-{\frac{4\,h}{6+3\,x}}+{\frac{g}{6+6\,x}}+{\frac{2\,g}{6+3\,x}}-{\frac{f}{6+6\,x}}-{\frac{d}{6+6\,x}}+{\frac{e}{6+6\,x}}-{\frac{d}{24+12\,x}}+{\frac{e}{12+6\,x}}-{\frac{f}{6+3\,x}}-{\frac{7\,\ln \left ( 1+x \right ) d}{36}}+{\frac{13\,\ln \left ( 1+x \right ) e}{36}}-{\frac{\ln \left ( -1+x \right ) d}{36}}-{\frac{\ln \left ( -1+x \right ) e}{36}}+{\frac{2\,\ln \left ( x-2 \right ) i}{9}}+{\frac{37\,\ln \left ( 1+x \right ) i}{36}}-{\frac{\ln \left ( -1+x \right ) i}{36}}-{\frac{2\,\ln \left ( 2+x \right ) i}{9}}+{\frac{\ln \left ( x-2 \right ) h}{9}}-{\frac{31\,\ln \left ( 1+x \right ) h}{36}}+{\frac{7\,\ln \left ( 2+x \right ) h}{9}}-{\frac{\ln \left ( -1+x \right ) h}{36}}+{\frac{25\,\ln \left ( 1+x \right ) g}{36}}+{\frac{\ln \left ( x-2 \right ) g}{18}}-{\frac{\ln \left ( -1+x \right ) g}{36}}-{\frac{13\,\ln \left ( 2+x \right ) g}{18}}+{\frac{\ln \left ( x-2 \right ) d}{144}}+{\frac{\ln \left ( x-2 \right ) e}{72}}-{\frac{25\,\ln \left ( 2+x \right ) e}{72}}+{\frac{\ln \left ( x-2 \right ) f}{36}}+{\frac{31\,\ln \left ( 2+x \right ) d}{144}}-{\frac{19\,\ln \left ( 1+x \right ) f}{36}}-{\frac{\ln \left ( -1+x \right ) f}{36}}+{\frac{19\,\ln \left ( 2+x \right ) f}{36}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((x^2-3*x+2)*(i*x^5+h*x^4+g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4)^2,x)

[Out]

1/6/(1+x)*i+8/3/(2+x)*i-1/6/(1+x)*h-4/3/(2+x)*h+1/6/(1+x)*g+2/3/(2+x)*g-1/6/(1+x
)*f-1/6/(1+x)*d+1/6/(1+x)*e-1/12/(2+x)*d+1/6/(2+x)*e-1/3/(2+x)*f-7/36*ln(1+x)*d+
13/36*ln(1+x)*e-1/36*ln(-1+x)*d-1/36*ln(-1+x)*e+2/9*ln(x-2)*i+37/36*ln(1+x)*i-1/
36*ln(-1+x)*i-2/9*ln(2+x)*i+1/9*ln(x-2)*h-31/36*ln(1+x)*h+7/9*ln(2+x)*h-1/36*ln(
-1+x)*h+25/36*ln(1+x)*g+1/18*ln(x-2)*g-1/36*ln(-1+x)*g-13/18*ln(2+x)*g+1/144*ln(
x-2)*d+1/72*ln(x-2)*e-25/72*ln(2+x)*e+1/36*ln(x-2)*f+31/144*ln(2+x)*d-19/36*ln(1
+x)*f-1/36*ln(-1+x)*f+19/36*ln(2+x)*f

_______________________________________________________________________________________

Maxima [A]  time = 0.708799, size = 188, normalized size = 1.28 \[ \frac{1}{144} \,{\left (31 \, d - 50 \, e + 76 \, f - 104 \, g + 112 \, h - 32 \, i\right )} \log \left (x + 2\right ) - \frac{1}{36} \,{\left (7 \, d - 13 \, e + 19 \, f - 25 \, g + 31 \, h - 37 \, i\right )} \log \left (x + 1\right ) - \frac{1}{36} \,{\left (d + e + f + g + h + i\right )} \log \left (x - 1\right ) + \frac{1}{144} \,{\left (d + 2 \, e + 4 \, f + 8 \, g + 16 \, h + 32 \, i\right )} \log \left (x - 2\right ) - \frac{{\left (3 \, d - 4 \, e + 6 \, f - 10 \, g + 18 \, h - 34 \, i\right )} x + 5 \, d - 6 \, e + 8 \, f - 12 \, g + 20 \, h - 36 \, i}{12 \,{\left (x^{2} + 3 \, x + 2\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((i*x^5 + h*x^4 + g*x^3 + f*x^2 + e*x + d)*(x^2 - 3*x + 2)/(x^4 - 5*x^2 + 4)^2,x, algorithm="maxima")

[Out]

1/144*(31*d - 50*e + 76*f - 104*g + 112*h - 32*i)*log(x + 2) - 1/36*(7*d - 13*e
+ 19*f - 25*g + 31*h - 37*i)*log(x + 1) - 1/36*(d + e + f + g + h + i)*log(x - 1
) + 1/144*(d + 2*e + 4*f + 8*g + 16*h + 32*i)*log(x - 2) - 1/12*((3*d - 4*e + 6*
f - 10*g + 18*h - 34*i)*x + 5*d - 6*e + 8*f - 12*g + 20*h - 36*i)/(x^2 + 3*x + 2
)

_______________________________________________________________________________________

Fricas [A]  time = 27.1214, size = 412, normalized size = 2.8 \[ -\frac{12 \,{\left (3 \, d - 4 \, e + 6 \, f - 10 \, g + 18 \, h - 34 \, i\right )} x -{\left ({\left (31 \, d - 50 \, e + 76 \, f - 104 \, g + 112 \, h - 32 \, i\right )} x^{2} + 3 \,{\left (31 \, d - 50 \, e + 76 \, f - 104 \, g + 112 \, h - 32 \, i\right )} x + 62 \, d - 100 \, e + 152 \, f - 208 \, g + 224 \, h - 64 \, i\right )} \log \left (x + 2\right ) + 4 \,{\left ({\left (7 \, d - 13 \, e + 19 \, f - 25 \, g + 31 \, h - 37 \, i\right )} x^{2} + 3 \,{\left (7 \, d - 13 \, e + 19 \, f - 25 \, g + 31 \, h - 37 \, i\right )} x + 14 \, d - 26 \, e + 38 \, f - 50 \, g + 62 \, h - 74 \, i\right )} \log \left (x + 1\right ) + 4 \,{\left ({\left (d + e + f + g + h + i\right )} x^{2} + 3 \,{\left (d + e + f + g + h + i\right )} x + 2 \, d + 2 \, e + 2 \, f + 2 \, g + 2 \, h + 2 \, i\right )} \log \left (x - 1\right ) -{\left ({\left (d + 2 \, e + 4 \, f + 8 \, g + 16 \, h + 32 \, i\right )} x^{2} + 3 \,{\left (d + 2 \, e + 4 \, f + 8 \, g + 16 \, h + 32 \, i\right )} x + 2 \, d + 4 \, e + 8 \, f + 16 \, g + 32 \, h + 64 \, i\right )} \log \left (x - 2\right ) + 60 \, d - 72 \, e + 96 \, f - 144 \, g + 240 \, h - 432 \, i}{144 \,{\left (x^{2} + 3 \, x + 2\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((i*x^5 + h*x^4 + g*x^3 + f*x^2 + e*x + d)*(x^2 - 3*x + 2)/(x^4 - 5*x^2 + 4)^2,x, algorithm="fricas")

[Out]

-1/144*(12*(3*d - 4*e + 6*f - 10*g + 18*h - 34*i)*x - ((31*d - 50*e + 76*f - 104
*g + 112*h - 32*i)*x^2 + 3*(31*d - 50*e + 76*f - 104*g + 112*h - 32*i)*x + 62*d
- 100*e + 152*f - 208*g + 224*h - 64*i)*log(x + 2) + 4*((7*d - 13*e + 19*f - 25*
g + 31*h - 37*i)*x^2 + 3*(7*d - 13*e + 19*f - 25*g + 31*h - 37*i)*x + 14*d - 26*
e + 38*f - 50*g + 62*h - 74*i)*log(x + 1) + 4*((d + e + f + g + h + i)*x^2 + 3*(
d + e + f + g + h + i)*x + 2*d + 2*e + 2*f + 2*g + 2*h + 2*i)*log(x - 1) - ((d +
 2*e + 4*f + 8*g + 16*h + 32*i)*x^2 + 3*(d + 2*e + 4*f + 8*g + 16*h + 32*i)*x +
2*d + 4*e + 8*f + 16*g + 32*h + 64*i)*log(x - 2) + 60*d - 72*e + 96*f - 144*g +
240*h - 432*i)/(x^2 + 3*x + 2)

_______________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((x**2-3*x+2)*(i*x**5+h*x**4+g*x**3+f*x**2+e*x+d)/(x**4-5*x**2+4)**2,x)

[Out]

Timed out

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.28695, size = 201, normalized size = 1.37 \[ \frac{1}{144} \,{\left (31 \, d + 76 \, f - 104 \, g + 112 \, h - 32 \, i - 50 \, e\right )}{\rm ln}\left ({\left | x + 2 \right |}\right ) - \frac{1}{36} \,{\left (7 \, d + 19 \, f - 25 \, g + 31 \, h - 37 \, i - 13 \, e\right )}{\rm ln}\left ({\left | x + 1 \right |}\right ) - \frac{1}{36} \,{\left (d + f + g + h + i + e\right )}{\rm ln}\left ({\left | x - 1 \right |}\right ) + \frac{1}{144} \,{\left (d + 4 \, f + 8 \, g + 16 \, h + 32 \, i + 2 \, e\right )}{\rm ln}\left ({\left | x - 2 \right |}\right ) - \frac{{\left (3 \, d + 6 \, f - 10 \, g + 18 \, h - 34 \, i - 4 \, e\right )} x + 5 \, d + 8 \, f - 12 \, g + 20 \, h - 36 \, i - 6 \, e}{12 \,{\left (x + 2\right )}{\left (x + 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((i*x^5 + h*x^4 + g*x^3 + f*x^2 + e*x + d)*(x^2 - 3*x + 2)/(x^4 - 5*x^2 + 4)^2,x, algorithm="giac")

[Out]

1/144*(31*d + 76*f - 104*g + 112*h - 32*i - 50*e)*ln(abs(x + 2)) - 1/36*(7*d + 1
9*f - 25*g + 31*h - 37*i - 13*e)*ln(abs(x + 1)) - 1/36*(d + f + g + h + i + e)*l
n(abs(x - 1)) + 1/144*(d + 4*f + 8*g + 16*h + 32*i + 2*e)*ln(abs(x - 2)) - 1/12*
((3*d + 6*f - 10*g + 18*h - 34*i - 4*e)*x + 5*d + 8*f - 12*g + 20*h - 36*i - 6*e
)/((x + 2)*(x + 1))